import os
import numpy as np

filePath = "/media/st/Application/Ubuntu/dataset/tj/1020/compose/label/my_val0802/"
save_file_path = "/media/st/Application/Ubuntu/dataset/tj/1020/compose/label/save/"
file_name_list = []
for i,j,k in os.walk(filePath):
    file_name_list = k

for idx in range(len(file_name_list)):
    print("file index: ", idx)
    file = open(filePath+file_name_list[idx], "r")
    tra_list = file.readlines()
    black_gt = []
    for i in range(len(tra_list)):
        black_gt.append(np.array(tra_list[i].strip().split(' '), dtype = np.float32 ))
    black_gt = np.array(black_gt)
    file.close()
    # print(black_gt)

    w_file = open(save_file_path+file_name_list[idx], 'w') 
    for i in range(len(tra_list)):
        w_file.write("14"+" "+str(black_gt[i,1])+" "+str(black_gt[i, 2])+" "+str(black_gt[i, 3])+" "+str(black_gt[i, 4])+"\n")
    w_file.close()

